# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=openal-soft
pkgver=1.23.1
pkgrel=0
pkgdesc="software implementation of OpenAL API"
url="https://openal-soft.org/"
arch="all"
license="LGPL-2.0-or-later"
depends_dev="
	alsa-lib-dev
	jack-dev
	libsndfile-dev
	portaudio-dev
	pulseaudio-dev
	"
makedepends="
	$depends_dev
	cmake
	linux-headers
	qt5-qtbase-dev
	samurai
	zlib-dev
	"
subpackages="$pkgname-libs $pkgname-dev"
source="$pkgname-$pkgver.tar.gz::https://github.com/kcat/openal-soft/archive/$pkgver.tar.gz"
options="!check" # no tests

build() {
	case "$CARCH" in
	armhf)
		local cpuext_neon=-DALSOFT_CPUEXT_NEON=OFF
	;;
	esac
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=MinSizeRel \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib \
		-DALSOFT_UPDATE_BUILD_VERSION=OFF \
		$cpuext_neon
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
21f768484978e4321b733004988cb5ecf43d908e7e08f2d421a338633fcfb2ade722d035de73742470ff135ab538d6b9b56df14020976adb1d1e081dfb095c6b  openal-soft-1.23.1.tar.gz
"
